import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *
testCase = "DBshop015_添加侧边设置"
firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu3(firefox,'商品管理','管理分类','前台侧边设置')
# 添加侧边设置
firefox.find_element_by_xpath("//a[@class='btn btn-small btn-primary']").click()
firefox.find_element_by_id("frontside_name").send_keys("网站很好看")
firefox.find_element_by_id("frontside_sort").clear()
firefox.find_element_by_id("frontside_sort").send_keys(255)
firefox.find_element_by_xpath("//button").click()
#断言
n = firefox.find_element_by_xpath("/html/body/div[2]/div/div[2]/form/table/tbody/tr[1]/td[1]").text
print(n)
s = "网站很好看"

if    n ==s:
    writeLog("%s 测试通过" % testCase)

else:
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)
firefox.quit()
